CREATE EXTERNAL TABLE jms_ods.yl_oms_oms_waybill_input_hi(
  `id` bigint COMMENT '主键id',                      
  `waybill_no` string COMMENT '运单号',               
  `waybill_status_code` bigint COMMENT '运单状态code',  
  `goods_type_id` bigint COMMENT '物品类型id',         
  `goods_type_code` string COMMENT '物品类型code',     
  `goods_type_name` string COMMENT '物品类型名称',       
  `goods_name` string COMMENT '物品名称',              
  `package_number` smallint COMMENT '件数,＞1表示子母件，如果业务上不支持子母件，则前端限制不显示，并默认为1',  
  `package_length` double COMMENT '包裹总长,单位厘米',     
  `package_wide` double COMMENT '包裹总宽,单位厘米',       
  `package_high` double COMMENT '包裹总高,单位厘米',       
  `package_volume` double COMMENT '包裹体积重,单位千克',    
  `package_total_weight` double COMMENT '包裹总重量,单位千克',  
  `package_total_volume` double COMMENT '包裹总体积,单位立方厘米',  
  `package_charge_weight` double COMMENT '包裹计费重量,单位千克',  
  `box_standard_code` string COMMENT '箱子规格code',   
  `box_standard_name` string COMMENT '箱子规格名称',     
  `box_number` smallint COMMENT '箱子数量',            
  `box_price` double COMMENT '箱子价格',               
  `collect_staff_code` string COMMENT '揽件业务员code',  
  `collect_staff_name` string COMMENT '揽件业务员名称',   
  `collect_time` timestamp COMMENT '揽件时间',         
  `dispatch_staff_code` string COMMENT '派件业务员code',  
  `dispatch_staff_name` string COMMENT '派件业务员名称',  
  `dispatch_time` timestamp COMMENT '派件时间',        
  `dispatch_network_id` bigint COMMENT '派件网点id',   
  `dispatch_network_code` string COMMENT '派件网点code',  
  `dispatch_network_name` string COMMENT '派件网点名称',  
  `exception_code` string COMMENT '异常原因编码',        
  `exception_reason` string COMMENT '',            
  `terminal_dispatch_code` string COMMENT '三段码',   
  `is_sign` smallint COMMENT '签收标识,1是，0否',         
  `sign_network_id` bigint COMMENT '签收网点id',       
  `sign_network_code` string COMMENT '签收网点code',   
  `sign_network_name` string COMMENT '签收网点名称',     
  `sign_finance_code` string COMMENT '签收财务网点编码',   
  `sign_finance_name` string COMMENT '签收财务网点名称',   
  `sign_time` timestamp COMMENT '签收时间',            
  `is_real_name` smallint COMMENT '是否实名制,1是，0否',   
  `id_no` string COMMENT '身份证号码',                  
  `is_abnormal` smallint COMMENT '问题件标识,1是，0否',    
  `abnormal_reg_network_code` string COMMENT '问题件登记网点code',  
  `abnormal_reg_network_name` string COMMENT '问题件登记网点名称',  
  `abnormal_reg_time` timestamp COMMENT '问题件登记时间',  
  `order_id` bigint COMMENT '内部订单编号',              
  `customer_order_id` string COMMENT '客户订单编号',     
  `waybill_source_code` string COMMENT '运单来源code',  
  `waybill_source_name` string COMMENT '运单来源名称',   
  `send_code` string COMMENT '寄件方式code',           
  `send_name` string COMMENT '寄件方式名称',             
  `dispatch_code` string COMMENT '派件方式code',       
  `dispatch_name` string COMMENT '派件方式名称',         
  `is_void` smallint COMMENT '是否作废件,1是，0否',        
  `is_refund` smallint COMMENT '1:已退件2:已转寄3:未退件4:退��件',  
  `is_need_receipt` smallint COMMENT '是否需要需要签回单,1是，0否',  
  `receipt_no` string COMMENT '回单编号',              
  `is_settlement` smallint COMMENT '结算审核标识,1是，0否',  
  `settlement_time` timestamp COMMENT '结算审核时间',    
  `customer_code` string COMMENT '客户编号code',       
  `customer_name` string COMMENT '客户编号名称',         
  `sender_name` string COMMENT '寄件人姓名',            
  `sender_mobile_phone` string COMMENT '寄件人手机号',   
  `sender_telphone` string COMMENT '寄件人座机',        
  `sender_country_id` bigint COMMENT '寄件国家Id',     
  `sender_country_name` string COMMENT '寄件国家名称',   
  `sender_province_id` bigint COMMENT '寄件省份id',    
  `sender_province_name` string COMMENT '寄件省份名称',  
  `sender_city_id` bigint COMMENT '寄件城市id',        
  `sender_city_name` string COMMENT '寄件城市名称',      
  `sender_area_id` bigint COMMENT '寄件区域Id',        
  `sender_area_name` string COMMENT '寄件区域名称',      
  `sender_township` string COMMENT '寄件乡镇',         
  `sender_street` string COMMENT '寄件街道',           
  `sender_detailed_address` string COMMENT '寄件详细地址',  
  `sender_postal_code` string COMMENT '寄件邮编',      
  `sender_email` string COMMENT '',                
  `origin_id` bigint COMMENT '始发地id',              
  `origin_code` string COMMENT '始发地code',          
  `origin_name` string COMMENT '始发地名称',            
  `pick_network_id` bigint COMMENT '寄件网点id',       
  `pick_network_code` string COMMENT '寄件网点code',   
  `pick_network_name` string COMMENT '寄件网点名称',     
  `freight` double COMMENT '运费',                   
  `package_cost` double COMMENT '包材费',             
  `total_freight` double COMMENT '总运费',            
  `tax` double COMMENT '税金',                       
  `handicraft_fee` double COMMENT '手工费',           
  `other_fee` double COMMENT '其他费',                
  `receive_pay_fee` double COMMENT '到付款',          
  `pick_finance_id` bigint COMMENT '寄件财务中心id',     
  `pick_finance_code` string COMMENT '寄件财务中心code',  
  `pick_finance_name` string COMMENT '寄件财务中心名称',   
  `dispatch_finance_code` string COMMENT '派件财务中心code',  
  `dispatch_finance_name` string COMMENT '派件财务中心名称',  
  `express_type_id` bigint COMMENT '产品类型id',       
  `express_type_code` string COMMENT '产品类型code',   
  `express_type_name` string COMMENT '产品类型名称',     
  `insured` smallint COMMENT '是否需要保价,1是，0否',       
  `insured_amount` double COMMENT '保价金额',          
  `insured_fee` double COMMENT '保价费',              
  `cod_need` smallint COMMENT '是否需要代收货款,1是，0否',    
  `cod_money` double COMMENT '代收货款金额',             
  `cod_fee` double COMMENT '代收货款手续费',              
  `settlement_id` bigint COMMENT '结算方式id',         
  `settlement_code` string COMMENT '结算方式编码',       
  `settlement_name` string COMMENT '结算方式名称',       
  `paid_mode_code` string COMMENT '支付方式编码',        
  `paid_mode_name` string COMMENT '支付方式名称',        
  `receiver_name` string COMMENT '收件人姓名',          
  `receiver_company` string COMMENT '收件人公司',       
  `receiver_mobile_phone` string COMMENT '收件人手机号',  
  `receiver_telphone` string COMMENT '收件人座机',      
  `receiver_country_id` bigint COMMENT '收件国家id',   
  `receiver_country_name` string COMMENT '收件国家名称',  
  `receiver_province_id` bigint COMMENT '收件省份id',  
  `receiver_province_name` string COMMENT '收件省份名称',  
  `receiver_city_id` bigint COMMENT '收件城市id',      
  `receiver_city_name` string COMMENT '收件城市名称',    
  `receiver_area_id` bigint COMMENT '收��区域id',      
  `receiver_area_name` string COMMENT '收件区域名称',    
  `receiver_township` string COMMENT '收件乡镇',       
  `receiver_street` string COMMENT '收件街道',         
  `receiver_detailed_address` string COMMENT '收件详细地址',  
  `receiver_postal_code` string COMMENT '收件邮编',    
  `receiver_email` string COMMENT '',              
  `destination_id` bigint COMMENT '目的地id',         
  `destination_code` string COMMENT '目的地code',     
  `destination_name` string COMMENT '目的地名称',       
  `receiver_sorting_code` string COMMENT '收件分拣码',  
  `input_time` timestamp COMMENT '录入时间',           
  `delivery_time` timestamp COMMENT '寄件时间',        
  `input_staff_code` string COMMENT '录入人code',     
  `input_staff_name` string COMMENT '录入人名称',       
  `input_network_code` string COMMENT '录入网点code',  
  `input_network_name` string COMMENT '录入网点名称',    
  `coupon_code` string COMMENT '优惠券编号',            
  `coupon_amount` double COMMENT '优惠金额',           
  `remarks` string COMMENT '',                     
  `prints_number` smallint COMMENT '打印次数',         
  `bill_no` string COMMENT '账单编号',                 
  `is_cash` smallint COMMENT '是否现金收款,1是，0否',       
  `is_cod_receive` smallint COMMENT 'COD收款标识,1是，0否',  
  `currency_code` string COMMENT '货币币别编码',         
  `currency_name` string COMMENT '货币币别名称',         
  `settlement_weight` double COMMENT '结算重量',       
  `customer_id` bigint COMMENT '客户id',             
  `order_source_code` string COMMENT '订单来源编码',     
  `last_update_time` timestamp COMMENT '最后更新时间',   
  `is_delete` smallint COMMENT '是否删除,1未删除，2已删除',   
  `is_plaintext` tinyint COMMENT '',               
  `refund_time` timestamp COMMENT '退件时间',          
  `input_staff_by` bigint COMMENT '录入人ID',         
  `real_name` string COMMENT '实名姓名',               
  `id_no_type` smallint COMMENT '证件类型',            
  `sex` smallint COMMENT '性别',                     
  `distribute_finance_id` bigint COMMENT '转运中心财务网点id',  
  `distribute_finance_code` string COMMENT '转运中心财务网点编码',  
  `distribute_finance_name` string COMMENT '转运中心财务网点名称',  
  `package_collect_weight` double COMMENT '收件重量,单位千克',  
  `package_receipt_weight` double COMMENT '入仓重量,单位千克',  
  `package_arrival_weight` double COMMENT '集散到件重量,单位千克',  
  `package_inside_charge_weight` double COMMENT '内部计费重量,单位千克',  
  `is_distribute_scan` smallint COMMENT '转运中心扫描标识:1=已转运,0=未转运,默认0',  
  `is_arrival_scan` smallint COMMENT '集散到件标识:1=是,0=否,默认0',  
  `waybill_weight` double COMMENT '运��重量,单位千克',     
  `miss_flag` smallint COMMENT '是否残缺,1残缺、0完整',     
  `is_business` smallint COMMENT '是否是商务件：0否，1是',   
  `is_receive` smallint COMMENT '是否已收款,1是，0否',     
  `customer_network_code` string COMMENT '客户网点code',  
  `customer_network_name` string COMMENT '客户网点名称',  
  `customer_type` bigint COMMENT '客户所属：1-总部共享,2-代理区共享,3-自有客户',  
  `calculate_fee_desc` string COMMENT '算费描述',      
  `calculate_fee_code` bigint COMMENT '算费描述code',  
  `printer_counterfoil` tinyint COMMENT '是否打印客户存根 0否，1是',  
  `quotetype_code` smallint COMMENT '报价标示 0:跨省件,1同城件,2同省件',  
  `receipt_fee` double COMMENT '回单费',              
  `package_center_arrival_weight` double COMMENT '中心到件重量',  
  `subscribe_source_code` string COMMENT '订单订阅来源 code',  
  `subscribe_source_name` string COMMENT '订单订阅来源 name',  
  `inspection_method` string COMMENT '手机密文',
  `invoice_no` string COMMENT '订单标记')
COMMENT '运单表—小时级更新'
PARTITIONED BY (
  `dt` string COMMENT '时间分区')
STORED AS parquet
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_ods.db/external/yl_oms_oms_waybill_input_hi';